package pl.com.qapps.datastore.berkeley;

import com.sleepycat.bind.tuple.TupleOutput;
import com.sleepycat.je.DatabaseEntry;

/**
 * Crates key for single index table. Really useful.
 * @author Jakub Dykowski
 *
 */
public class SinglePropertyKey extends DatabaseEntry {

	private static final long serialVersionUID = 8823025491873579339L;

	public SinglePropertyKey(String kind, String property, byte[] value) {
		TupleOutput out = new TupleOutput();
		out.writeString(kind);
		out.writeString(property);
		out.write(value);
		setData(out.getBufferBytes(), out.getBufferOffset(),
				out.getBufferLength());
	}
}
